<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE HTML>
<html>
<head>
    <base href="<%=basePath%>">
    <title></title>
    <meta http-equiv="cache-control" content="no-cache">

    <link rel="stylesheet" type="text/css" href="/css/edittable.css"  ></link>
    <link rel="stylesheet" type="text/css" href="/css/validate.css"  ></link>
    <script type="text/javascript"  src="/js/jquery-1.8.0.js"></script>

    <script>

        $(function (){
            $("#BigName").ready(function (){
                var id
                $.ajax({
                    url:"GoodsServlet",
                    type:"post",
                    async:false,
                    dataType:"json",
                    data:{flag:"selectBigName"},
                    success:function (data){
                        $("#BigName").empty();
                        $("#BigName").append("<option>==请选择==</option>");
                        for(var i = 0;i<data.length;i++){
                            var bigName = data[i];
                            var str="<option value='"+bigName.id+"'>"+bigName.cateName+"</option>";
                            $("#BigName").append(str);
                        }
                        $("#BigName").val("${bigCateId}");
                    }
                });
            });

            // $("#BigName").change();
        });

    </script>

</head>

<body>
    <div class ="div_title">
        <div class="div_titlename"> <img src="/images/san_jiao.gif" ><span>新建二级分类</span></div>
    </div>
    <form action="GoodsServlet" method="post" onsubmit="return validate()" >
        <input type="hidden" name="flag" value="addSmallCate" >

        <table class="edit_table" >
            <tr>
                <td class="td_info">父级分类:</td>
                <td class="td_input_short">
                    <select type="text" class="txtbox" id="BigName" name="BigName" >
                    </select>
                </td>
                <td>
                    <label class="validate_info" id="BigName_msg">必选</label>
                </td>
            </tr>
            <tr>
                <td class="td_info">二级分类名:</td>
                <td class="td_input_short">
                    <input type="text" class="txtbox" id="cateName" name="cateName" value="${param.cateName }"/>
                </td>
                <td>
                    <label class="validate_info" id="cateName_msg">2-15位；只限数字、英文(不区分大小写)、中文</label>
                </td>
            </tr>
            <tr>
                <td class="td_info">描述信息:</td>
                <td><textarea rows="4" cols="27" name="des" class="txtarea" >${param.des }</textarea> </td>
                <td><label></label></td>
            </tr>
            <tr>
                <td class="td_info"> </td>
                <td>
                    <input class="form_btn" type="submit" value="提交" />
                    <input type="reset"  class="form_btn" value="重置" /> </td>
                <td>
                    <label id="result_msg" class="result_msg">${msg}</label>
                </td>
            </tr>
        </table>
    </form>

</body>
</html>